package annotationService.application;

import java.util.ArrayList;
import java.util.regex.Pattern;

/**
 * VGI class representing VGI objects
 * @author Andres Westermann
 *
 */
public class VGI {
	private String kmllink;
	private String subject;
	private String content;
	private ArrayList<String> tags = new ArrayList<String>();
	private ArrayList<String> savedAnnotations = new ArrayList<String>();

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getTags() {
		return tags.toString();
	}

	public void setTags(String tags) {
		String[] segs = tags.split(Pattern.quote(";"));
		for (int i = 0; i < segs.length; i++) {
			this.tags.add(segs[i]);
		}
	}

	public String getKmllink() {
		return kmllink;
	}

	public void setKmllink(String kmllink) {
		this.kmllink = kmllink;
	}

	public void setsavedAnnotations(String category) {
		if (category.contains(";")) {
			String[] segs = category.split(Pattern.quote(";"));
			for (int i = 0; i < segs.length; i++) {
				this.savedAnnotations.add(segs[i]);
			}
		} else {
			this.savedAnnotations.add(category);
		}
	}

	public String getsavedAnnotations() {
		return savedAnnotations.toString();
	}

}
